import java.util.*;

public class Test2 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str1 = scan.nextLine() ;
        String str2 = scan.nextLine() ;
        Set<Character> set = new HashSet<>() ;
        for (int i = 0 ; i < str2.length() ; i ++) {
            char tmp = str2.charAt(i);
            set.add(tmp);
        }
        Set<Character> set2 = new HashSet<>() ;
        for (int i = 0; i < str1.length(); i++) {
            char tmp = str1.charAt(i);
            if (!set.contains(tmp)) {
                if (tmp >= 'a' && tmp <= 'z') {
                    tmp = (char) (tmp - 'a' + 'A');
                }
                if (!set2.contains(tmp)) {
                    set2.add(tmp);
                    System.out.print(tmp);
                }
            }
        }
    }
    public static List<String> topKFrequent(String[] words, int k) {
        Map<String , Integer> map = new HashMap<>() ;
        for(String str : words){
            if(map.containsKey(str)){
                int val = map.get(str);
                map.put(str,val+1);
            }else{
                map.put(str,1);
            }
        }
        List<String> list = new ArrayList<>() ;
        for(int i =0 ;i < k ; i++){
            String str = words[0] ;
            int max = map.get(str) ;
            for(int j = 1 ; j < words.length ; j ++){
                int val = map.get(words[j]);
                if(max < val){
                    str = words[j];
                    max = val;
                }
            }
            list.add(str);
            map.put(str,0);
        }
        return list ;


    }

    public Node copyRandomList(Node head) {
        Map<Node , Node> map = new HashMap<>() ;
        Node cur = head ;
        while(cur != null){
            Node node = new Node(cur.val);
            map.put(cur,node);
            cur = cur.next ;
        }
        cur = head;
        while (cur != null){
            Node tmp = map.get(cur);
            tmp.next = map.get(cur.next);
            tmp.random = map.get(cur.random);
        }
        return map.get(head);
    }
}
class Node {
    int val;
    Node next;
    Node random;

    public Node(int val) {
        this.val = val;
        this.next = null;
        this.random = null;
    }
}